<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="com.book.DbManager"%>
<%@page import="com.sun.corba.se.pept.transport.Connection"%>
<%@page import="java.beans.Statement"%>
<%@page import="java.sql.ResultSet"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<link type="text/css" rel="stylesheet" href="book.css">
<title>将修改后的数据保存到数据库</title>
</head>
<body>
<%
	String isbn = request.getParameter("isbn");
	String name = request.getParameter("name");
	String author = request.getParameter("author");
	String price = request.getParameter("price");
	if (isbn == null || name == null || author == null || price == null
			|| isbn.equals("") || name.equals("") || author.equals("")
			|| price.equals("")) {
		out
				.println("填写不够完整，<a href='http://localhost:8080/struts2-blank-2.0.14/example/update.jsp'>请返回</a>");
	}
	String updatesql = "update book set isbn='" + isbn + "',name='"
			+ name + "',author='" + author + "',price=" + price
			+ " where isbn=" + isbn;
	DbManager.exeSql(updatesql);
	String selectSql = "select * from book where ISBN='" + isbn + "'";
	try {
		ResultSet rst = DbManager.getRst(selectSql);
%>
<table align="center">
	<tr>
		<td>
		<h1>
		<%
			out.println("修改成功");
		%>
		</h1>
		</td>
	</tr>
</table>
<%
	} catch (Exception e) {
		out.println("修改失敗");
	}
%>
<table align="center">
	<tr>
		<td>
		<h2><a
			href="http://localhost:8080/struts2-blank-2.0.14/example/adminBook.jsp">返回管理页面</a>
		</h2>
		</td>
	</tr>
</table>
</body>
</html>